Class yassl.Env
All Packages    This Package    Previous    Next

Class yassl.Env

java.lang.Object
   |
   +----yassl.Env

public class Env
extends Object
This is effectively a frame for a method call. It contains bindings for varnodes -> contents. Like Scheme, bindings for variables are determined by searching for its value upwards from the frame in which an expression is evaluated.

The other thing implemented here is dynamic loading of toplevel functions. If a symbol is not found, a getClass() is performed on a mangled version of the name to try and get the function definition. This needs to be fixed to be done only when the variable is a lambdanode.


Variable Index

 o local
local variable binding table
 o parent
parent environment.

Constructor Index

 o Env()

Method Index

 o define(String, pnode)
add a new variable to the environment
 o define(String[], pnode[])
add a set of new variables to the environment
 o search(String)
Searching looks up the object, and bumps the query up to the parent if necessary.
 o set(String, pnode)
set! an existing variable to a new value.

Variables

 o local
  public Hashtable local
local variable binding table
 o parent
  public Env parent
parent environment. If a binding is not found here, the search is passed up to this environment.

Constructors

 o Env
  public Env()

Methods

 o set
  public void set(String v,
                  pnode binding) throws yasslError
set! an existing variable to a new value.

 o define

  public void define(String v,
                     pnode binding)
add a new variable to the environment

 o define

  public void define(String v[],
                     pnode b[]) throws yasslError
add a set of new variables to the environment

 o search

  public pnode search(String v) throws yasslError
Searching looks up the object, and bumps the query up to the parent if necessary. If a binding is not found, a last ditch attempt is made to try to get it as a lambda node from a class. This needs to be fixed to first verify the varnode is of a lambda type.


All Packages    This Package    Previous    Next